<?php
namespace App\Http\Requests\User;

use App\Http\Requests\Request;

/**
 * 注册验证信息
 *
 * @package App\Http\Requests\User
 * @author zx
 * @date 2018-11-23
 */
class RegisterRequest extends Request {

    public function rules():array
    {
        return [
            'nickname' => 'required|between:1,10',
            'number' => 'required',
            'password' => 'required|min:6|max:18|alpha_num',
            'code' => 'alpha_dash|min:4|max:4',
            'lon' => 'numeric',
            'lat' => 'numeric'
        ];
    }

    public function messages()
    {
        return [
            'nickname.required' => '昵称必须',
            'nickname.between' => '昵称不能少于一个字符且不能超过十个字符',
            'number.required' => '账号必须',
            'password.required' => '密码必填',
            'password.min' => '密码最低6位',
            'password.max' => '密码最高18位',
            'password.alpha_num' => '密码必须为数字和字母',
            'code.alpha_num' => '验证码为数字或字母',
            'code.min' => '验证码格式错误',
            'code.max' => '验证码格式错误',
            'lon.numeric' => '经纬度格式错误',
            'lat.numeric' => '经纬度格式错误'
        ]; // TODO: Change the autogenerated stub
    }

}